frame: Don't queue a resize if xalign changes
authorMatthias Clasen <mclasen@redhat.com>
Sun, 3 May 2020 15:39:58 +0000 (11:39 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 4 May 2020 11:37:25 +0000 (07:37 -0400)
We only need to allocate children in this case.
While we touch it, rewrite the setter to modern
style.

gtk/gtkframe.c

index 26880beb20980ef295ea671fb0a53eefa41a8132..6381e6974d9e4701507fe6ee69e2f4de656daa29 100644 (file)
@@ -461,16 +461,12 @@ gtk_frame_set_label_align (GtkFrame *frame,
   g_return_if_fail (GTK_IS_FRAME (frame));
 
   xalign = CLAMP (xalign, 0.0, 1.0);
+  if (priv->label_xalign == xalign)
+    return;
 
-  g_object_freeze_notify (G_OBJECT (frame));
-  if (xalign != priv->label_xalign)
-    {
-      priv->label_xalign = xalign;
-      g_object_notify_by_pspec (G_OBJECT (frame), frame_props[PROP_LABEL_XALIGN]);
-    }
-
-  g_object_thaw_notify (G_OBJECT (frame));
-  gtk_widget_queue_resize (GTK_WIDGET (frame));
+  priv->label_xalign = xalign;
+  g_object_notify_by_pspec (G_OBJECT (frame), frame_props[PROP_LABEL_XALIGN]);
+  gtk_widget_queue_allocate (GTK_WIDGET (frame));
 }
 
 /**